#include <stdio.h>
#include <assert.h>

void* my_memmove(void* dst, const void* src, size_t count)
{
	void* ret = dst;
	assert(dst && src);
	if (dst < src) 
	{
		while (count--) 
		{
			*(char*)dst = *(char*)src;
			dst = (char*)dst + 1;
			src = (char*)src + 1;
		}
	}
	else 
	{
		while (count--) 
		{
			*((char*)dst + count) = *((char*)src + count);
		}
	}
	return(ret);
}

int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
	my_memmove(arr + 2, arr, 16);
	for (int i = 0; i < 10; i++)
	{
		printf("%d", arr[i]);
	}
	return 0;
}